home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Includes / files / files.i < prev    next >
Encoding:
Text File  |  1997-10-11  |  3.8 KB  |  150 lines

  1.     IFND FILES_FILES_I
  2. FILES_FILES_I  SET  1
  3.  
  4. **
  5. **  $VER: files.i V0.9B
  6. **
  7. **  File Definitions.
  8. **
  9. **  (C) Copyright 1996-1997 DreamWorld Productions.
  10. **      All Rights Reserved.
  11. **
  12. **
  13.  
  14.     IFND    DPKERNEL_I
  15.     include 'games/dpkernel.i'
  16.     ENDC
  17.  
  18. ****************************************************************************
  19. * Module information.
  20.  
  21. FileModVersion  = 0
  22. FileModRevision = 9
  23.  
  24. ****************************************************************************
  25. * Mini structures for source and destination operations.
  26.  
  27. ;Filename structure.
  28.  
  29.    STRUCTURE    FN,0
  30.     WORD    FN_ID           ;ID_FILENAME
  31.     APTR    FN_Name         ;Pointer to filename.
  32.     LABEL    FN_SIZEOF       ;Private.
  33.  
  34. ;Memory pointer structure.
  35.  
  36.    STRUCTURE    MPTR,0
  37.     WORD    MPTR_ID           ;ID_MEMPOINTER
  38.     APTR    MPTR_Address      ;Pointer to memory area.
  39.     LONG    MPTR_Size         ;Must supply a size unless you are a MemBlock.
  40.     LABEL    MPTR_SIZEOF       ;Private.
  41.  
  42.  
  43.     ;Example: FILENAME "HD1:Picture.iff"
  44.  
  45. FILENAME MACRO
  46.     dc.w    ID_FILENAME
  47.     dc.l    .name\@
  48. .name\@    dc.b    \1,0
  49.     even
  50.     ENDM
  51.  
  52.     ;Example: MEMPTR $530
  53.  
  54. MEMPTR    MACRO
  55.     dc.w    ID_MEMPTR
  56.     dc.l    \1
  57.     dc.l    \2
  58.     ENDM
  59.  
  60. *****************************************************************************
  61. * File Object.
  62.  
  63. FILEVERSION =    1
  64. TAGS_FILE   =    (ID_SPCTAGS<<16)|ID_FILE
  65.  
  66.    STRUCTURE    FL,HEAD_SIZEOF   ;Standard header.
  67.     LONG    FL_BytePos       ;Current position in file.
  68.     LONG    FL_Size          ;Total size of the file.
  69.     LONG    FL_Flags         ;File flags.
  70.     APTR    FL_Source        ;Points to the Source descriptor.
  71.     APTR    FL_Prev          ;Previous file in chain.
  72.     APTR    FL_Next          ;Next file in chain.
  73.     APTR    FL_Comment       ;Pointer to comment string.
  74.     APTR    FL_Date          ;Time of creation.
  75.     LONG    FL_Permissions   ;User permission flags.
  76.  
  77. ;File tags.
  78.  
  79. FLA_BytePos = (TLONG|FL_BytePos)
  80. FLA_Size    = (TLONG|FL_Size)
  81. FLA_Flags   = (TLONG|FL_Flags)
  82. FLA_Source  = (TAPTR|FL_Source)
  83. FLA_Prev    = (TAPTR|FL_Prev)
  84. FLA_Next    = (TAPTR|FL_Next)
  85. FLA_Comment = (TAPTR|FL_Comment)
  86. FLA_Date    = (TAPTR|FL_Date)
  87.  
  88. ;Opening tags.
  89.  
  90. FB_READ      = 0   ;Default.
  91. FB_WRITE     = 0   ;Set if writing to the file.
  92. FB_LOCK      = 1   ;Locks other programs out from using this file.
  93. ;FB_NEW      = 2   ;
  94. FB_FIND      = 3   ;
  95. FB_NOUNPACK  = 4   ;Disallow auto-unpacking of the data.
  96. FB_NOPACK    = 4   ;Disallow auto-packing of the data.
  97. FB_NOBUFFER  = 5   ;
  98. FB_NEWFILE   = 6   ;Open a new file (size of 0).
  99. FB_ALPHASORT = 7   ;Applies to directories only.
  100.  
  101. FL_OLDFILE   = 0
  102. FL_READ      = 0
  103. FL_WRITE     = (1<<FB_WRITE)
  104. FL_LOCK      = (1<<FB_LOCK)
  105. ;FL_NEW      = (1<<FB_NEW)
  106. FL_FIND      = (1<<FB_FIND)
  107. FL_NOUNPACK  = (1<<FB_NOUNPACK)
  108. FL_NOPACK    = (1<<FB_NOPACK)
  109. FL_NOBUFFER  = (1<<FB_NOBUFFER)
  110. FL_NEWFILE   = (1<<FB_NEWFILE)
  111. FL_ALPHASORT = (1<<FB_ALPHASORT)
  112.  
  113. ****************************************************************************
  114. * Permission flags for Files and Directories.
  115.  
  116. FPT_READ     = $00000001
  117. FPT_WRITE    = $00000002
  118. FPT_EXECUTE  = $00000004
  119. FPT_DELETE   = $00000008
  120. FPT_SCRIPT   = $00000010
  121. FPT_HIDDEN   = $00000020
  122. FPT_ARCHIVE  = $00000040
  123. FPT_PASSWORD = $00000080
  124.  
  125. *****************************************************************************
  126. * Directory Object.
  127.  
  128. DIRVERSION     = 1
  129. TAGS_DIRECTORY = (ID_SPCTAGS<<16)|ID_DIRECTORY
  130.  
  131.    STRUCTURE    DIR,HEAD_SIZEOF
  132.     APTR    DIR_ChildDir     ;First sub-directory under this dir.
  133.     APTR    DIR_ChildFile    ;First file under this directory.
  134.     APTR    DIR_Source       ;Location of the directory.
  135.     LONG    DIR_Flags        ;Opening flags (see file flags).
  136.     APTR    DIR_Comment      ;Comment string.
  137.     LONG    DIR_Permissions  ;User flags.
  138.     APTR    DIR_Date         ;Pointer to Time structure.
  139.     APTR    DIR_Next         ;Next directory in this list.
  140.     APTR    DIR_Prev         ;Previous directory in this list.
  141.  
  142. DIRA_Source      = (TAPTR|DIR_Source)
  143. DIRA_Flags       = (TLONG|DIR_Flags)
  144. DIRA_Permissions = (TLONG|DIR_Permissions)
  145. DIRA_Comment     = (TAPTR|DIR_Comment)
  146. DIRA_Date        = (TAPTR|DIR_Date)
  147.  
  148.   ENDC    ;FILES_FILES_I
  149.  
  150.